﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ElingOA6_Admin_DSJCJ.BLL
{
    public class Attendance
    {
        /// <summary>
        /// 定义便利DAL
        /// </summary>
        private readonly DAL.Attendance dal = new DAL.Attendance();
        /// <summary>
        /// 构造函数
        /// </summary>
        public Attendance()
        {
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <creator>chenly</creator>
        /// <date>2014-03-11</date> 
        /// <param name="model">model</param>
        /// <returns></returns>
        public decimal Add(Model.Attendance model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public Model.Attendance GetModel(string loginID, string today)
        {
            return dal.GetModel(loginID, today);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public Model.Attendance GetModelASC(string loginID, string today)
        {
            return dal.GetModelASC(loginID, today);
        }
        /// <summary>
        /// 获取该人员特定时间的最早的考勤记录
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="entityNo"></param>
        /// <param name="emplNo"></param>
        /// <returns></returns>
        public DateTime? GetFirstAttendanceRecord(DateTime dt, string entityNo, string emplNo)
        {
            return dal.GetFirstAttendanceRecord(dt, entityNo, emplNo);
        }
         /// <summary>
        /// 获取该人员特定时间的最晚的考勤记录
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="entityNo"></param>
        /// <param name="emplNo"></param>
        /// <returns></returns>
        public DateTime? GetLastAttendanceRecord(DateTime dt, string entityNo, string emplNo)
        {
            return dal.GetLastAttendanceRecord(dt, entityNo, emplNo);
        }
        /// <summary>
        /// 上午的考勤时间
        /// </summary>
        /// <param name="entityNo">公司编号</param>
        /// <param name="emplNo">员工编号</param>
        /// <returns></returns>
        public DataSet GetAMAttendanceTimeDS(string entityNo, string emplNo, string today)
        {
            return dal.GetAMAttendanceTimeDS(entityNo, emplNo, today);
        }
        /// <summary>
        /// 下午午的考勤时间
        /// </summary>
        /// <param name="entityNo">公司编号</param>
        /// <param name="emplNo">员工编号</param>
        /// <returns></returns>
        public DataSet GetPMAttendanceTimeDS(string entityNo, string emplNo, string today)
        {
            return dal.GetPMAttendanceTimeDS(entityNo, emplNo, today);
        }
    }
}
